< previous page page_312 next page >

Page 312
data grid form you created in Day 9 into an ActiveX control that you'll then add to the Explorer interface. Remember, a control has no Load routine, but it has an Initialize routine. The first thing you need to do is list the routines in the form. For this example, the routines are Form_Load, datPrimaryRS_Validate, datPrimaryRS_Reposition, and datPrimaryRS_Error. Then you want to map these to their corresponding routines in the control that you'll create.
Now it's time to start a new control project while you have the Address Book project open. After you add the new project, use the ActiveX control wizard to create the members that you need to interact with the control. For this form, you'll need the sizing propertiesLeft, Top, Width, Height, and Visiblewhich are added automatically for you. You also need the Refresh method and the Click event.
The next step is to re-create the forms design on the new control. You can do this very easily by copying all the controls on the form and pasting them on the control, as shown in Figure 11.16.
12181-0312a.gif
Figure 11.16.
Using the Windows Cut and Paste functions allows you to create
a control from a form fairly quickly.
Tip
When you copy the controls, all the properties and names are copied with them.

 
< previous page page_312 next page >

If you like this book, buy it!